import request from '@/utils/request'

// 查询财务-约瑟员工花名册列表
export function listEmployeeRoster(query) {
    return request({
        url: '/quick/employeeRoster/list',
        method: 'get',
        params: query
    })
}

// 查询财务-约瑟员工花名册详细
export function getEmployeeRoster(id) {
    return request({
        url: '/quick/employeeRoster/' + id,
        method: 'get'
    })
}

// 新增财务-约瑟员工花名册
export function addEmployeeRoster(data) {
    return request({
        url: '/quick/employeeRoster',
        method: 'post',
        data: data
    })
}

// 修改财务-约瑟员工花名册
export function updateEmployeeRoster(data) {
    return request({
        url: '/quick/employeeRoster',
        method: 'put',
        data: data
    })
}

// 删除财务-约瑟员工花名册
export function delEmployeeRoster(id) {
    return request({
        url: '/quick/employeeRoster/' + id,
        method: 'delete'
    })
}

// 导入员工花名册
export function importEmployeeRoster(data) {
    return request({
        url: '/quick/employeeRoster/importData',
        method: 'post',
        data: data
    })
}

// 下载员工花名册导入模板
export function importTemplate() {
    return request({
        url: '/quick/employeeRoster/importTemplate',
        method: 'post',
        responseType: 'blob'
    })
}

// 文件上传
export function uploadFile(data) {
    return request({
        url: '/quick/employeeRoster/uploadImage',
        method: 'post',
        data: data
    })
}

// 查询用户列表 (用于用户姓名选择)
// 调用后端 SysUserController.java 的 @PostMapping("/selectUserList") 接口
export function listUser(query) {
    return request({
        url: '/system/user/selectUserList',
        method: 'post',
        data: query // query 将作为请求体发送
    })
}
